<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">设备照片</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="deviceImgForm" method="post"
                        enctype="multipart/form-data">
                        <!--大架子号(big_shelf_num)-->
                        <div class="am-form-group">
                            <label for="bigShelfNum" class="am-u-sm-2 am-form-label">大架子号
                                <span class="tpl-form-line-small-title">bigShelfNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="bigShelfNum" class="tpl-form-input" placeholder="请输入"
                                       name="bigShelfNum"/>
                            </div>
                        </div>
                        <!--设备左前照片(device_front_lift_img)-->
                        <div class="am-form-group">
                            <label for="deviceFrontLiftImg" class="am-u-sm-2 am-form-label">设备左前照片
                                <span class="tpl-form-line-small-title">deviceFrontLiftImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileOne" type="file"/>
                                <input id="deviceFrontLiftImg" type="hidden" name="deviceFrontLiftImg"/>
                            </div>
                        </div>
                        <!--设备右前照片(device_front_right_img)-->
                        <div class="am-form-group">
                            <label for="deviceFrontRightImg" class="am-u-sm-2 am-form-label">设备右前照片
                                <span class="tpl-form-line-small-title">deviceFrontRightImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileTwo" type="file"/>
                                <input id="deviceFrontRightImg" type="hidden" name="deviceFrontRightImg"/>
                            </div>
                        </div>
                        <!--设备左后照片(device_lift_after_img)-->
                        <div class="am-form-group">
                            <label for="deviceLiftAfterImg" class="am-u-sm-2 am-form-label">设备左后照片
                                <span class="tpl-form-line-small-title">deviceLiftAfterImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileThree" type="file"/>
                                <input id="deviceLiftAfterImg" type="hidden" name="deviceLiftAfterImg"/>
                            </div>
                        </div>
                        <!--设备右后照片(device_right_after_img)-->
                        <div class="am-form-group">
                            <label for="deviceRightAfterImg" class="am-u-sm-2 am-form-label">设备右后照片
                                <span class="tpl-form-line-small-title">deviceRightAfterImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileFour" type="file"/>
                                <input id="deviceRightAfterImg" type="hidden" name="deviceRightAfterImg"/>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">
                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                                <button type="button" onclick="loadPage('deviceImg/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();
    var valdater;

    function validateUserForm() {
        valdater = $('#deviceImgForm').validate({
            errorElement: 'span',
            errorClass: 'am-icon-times',
            focusInvalid: true,
            onkeyup: false,
            ignore: "",
            rules: {
                title: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请填写名称"
                }
            }
        });
    }

    function doSubmit() {
        if (valdater.form()) {
            commit('deviceImgForm', 'deviceImg/save', 'deviceImg/listUI');
            return true;
        }
        return false;
    }
    initUpFileOne('upFileOne', 'deviceFrontLiftImg', '设备左前照片', '');
    initUpFileOne('upFileTwo', 'deviceFrontRightImg', '设备右前照片', '');
    initUpFileOne('upFileThree', 'deviceLiftAfterImg', '设备左后照片', '');
    initUpFileOne('upFileFour', 'deviceRightAfterImg', '设备右后照片', '');
    //initUpFileOne('upFile','coverImg','添加封面图片','');

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>